<template>
  <div class="DecRoot">
    <el-card class="box-card">
      <div class="headerBox">
        <div class="leftBox">
          <el-form :inline="true" :model="formInline" class="demo-form-inline">
            <el-form-item label="">
              <el-select v-model="formInline.sbid" placeholder="字典名称">
                <el-option
                  :label="item.sbmc"
                  v-for="(item, index) in addList"
                  :key="index"
                  :value="item.id"
                ></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="">
              <el-input
                v-model="formInline.zjmc"
                placeholder="字典类型"
              ></el-input>
            </el-form-item>
            <el-form-item>
              <el-button icon="el-icon-search" type="primary" @click="getList"
                >查询</el-button
              >
              <el-button icon="el-icon-refresh" @click="chongzhi"
                >重置</el-button
              >
            </el-form-item>
          </el-form>
        </div>
        <el-button
          type="primary"
          icon="el-icon-plus"
          @click="dialogVisible = true"
          plain
          >新增</el-button
        >
      </div>
    </el-card>
    <el-card class="box-card newCard">
      <el-table
        :data="tableData"
        style="width: 100%"
        height="66vh"
        header-cell-class-name="tableHeader"
        stripe
      >
        <el-table-column label="序号" type="index" width="50">
        </el-table-column>
        <el-table-column prop="sbmc" label="字典名称"> </el-table-column>
        <el-table-column prop="zjmc" label="字典类型"> </el-table-column>
        <el-table-column prop="ssdw" label="创建时间"> </el-table-column>
        <el-table-column prop="address" label="操作">
          <template slot-scope="scope">
            <el-tooltip
              class="item"
              effect="dark"
              content="删除"
              placement="top"
            >
              <img
                src="@/assets/image/icon/del.png"
                @click="del(scope.row.id)"
                class="iconImg"
                alt=""
              />
            </el-tooltip>
          </template>
        </el-table-column>
      </el-table>
      <div class="pagination">
        <div></div>
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="1"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "login",
  data() {
    return {
      dialogVisible: false,
      total: 2,
      formInline: {
        pageNum: 1,
        pageSize: 10,
        sbid: "",
        zjmc: "",
      },
      tableData: [{}],
    
    };
  },
  created() {},
  methods: {

    //分页
    handleSizeChange(val) {
      this.formInline.pageSize = val;
      this.getList();
    },
    handleCurrentChange(val) {
      this.formInline.pageNum = val;
      this.getList();
    },
   
  },
};
</script>

<style scoped lang="scss">
.newDialog {
  .headerBox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;

    .leftBox {
      display: flex;
      align-items: center;

      /deep/ .el-form-item {
        margin-bottom: 0;
      }

      /deep/ .el-input--suffix {
        width: 200px;
      }
    }
  }

  /deep/ .tableHeader {
    background: #edf3ff;
    font-weight: 700;
    color: #666666;
  }

  .iconImg {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin-right: 10px;
  }

  .pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;

    /deep/ .el-pagination__editor.el-input .el-input__inner {
      height: 28px !important;
    }

    /deep/ .el-input--mini .el-input__inner {
      height: 28px !important;
    }
  }

  /deep/ .el-select {
    width: 100%;
  }

  /deep/ .el-divider {
    margin: 0px;
  }
}

.btnBox {
  display: flex;
  justify-content: center;
  background: #fff;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 10px 0;

  .btnImg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
  }
}

.DecRoot {
  padding: 20px;
  padding-left: 5px;
  padding-bottom: 0;

  .newCard {
    height: 75vh;
    margin-top: 20px;
  }

  /deep/ .el-button {
    padding: 9px 15px;
  }

  .el-card {
    .headerBox {
      display: flex;
      justify-content: space-between;
      align-items: center;

      .leftBox {
        display: flex;
        align-items: center;

        /deep/ .el-form-item {
          margin-bottom: 0;
        }

        /deep/ .el-input--suffix {
          width: 200px;
        }
      }
    }

    /deep/ .tableHeader {
      background: #edf3ff;
      font-weight: 700;
      color: #666666;
    }

    .iconImg {
      width: 20px;
      height: 20px;
      cursor: pointer;
      margin-right: 10px;
    }

    .pagination {
      display: flex;
      justify-content: space-between;
      margin-top: 10px;

      /deep/ .el-pagination__editor.el-input .el-input__inner {
        height: 28px !important;
      }

      /deep/ .el-input--mini .el-input__inner {
        height: 28px !important;
      }
    }
  }
}
</style>
